package com.ytjj.qmyx.supplychain.common.enums;

/**
 * @ClassName (退款责任)退货责任 0-仓库承担 1-仓库与客户 2-平台与仓库 3-平台承担  4-客户承担
 * @Description TODO
 *
 * 
 * @Version 1.0
 **/
public enum ReturnDutyEnum {
    WAREHOUSE(0,"仓库承担"),
    WAREHOUSE_CLIENT(1, "仓库与客户"),
    WAREHOUSE_PLATFORM(2, "平台与仓库"),
    PLATFORM(3, "平台承担"),
    CLIENT(4, "客户承担"),
    ;

    private Integer code;
    private String message;

    ReturnDutyEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(Integer code){
        for (ReturnDutyEnum value : ReturnDutyEnum.values()) {
            if(value.getCode().equals(code)){
                return value.getMessage();
            }
        }
        return null;
    }

    public static Integer getCodeByMessage(String message){
        for (ReturnDutyEnum value : ReturnDutyEnum.values()) {
            if(value.getMessage().equals(message)){
                return value.getCode();
            }
        }
        return null;
    }
}
